package com.example.hello;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.provider.AlarmClock;
import android.util.Log;
import android.view.View;

import java.util.Calendar;

public class IntentActivity extends AppCompatActivity {

    Calendar calendar = Calendar.getInstance();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_intent);
    }
    public void openOne(View btn){
        //打开一个页面activity
        Log.i("open","openOne");
        if(btn.getId()==R.id.bt_intent_score){
            Intent score=new Intent(this,MainActivity.class);//窗口对象
            startActivity(score);
        }else if(btn.getId()==R.id.bt_intent_tel){
            Intent tel=new Intent(Intent.ACTION_DIAL,Uri.parse("tel:11111111"));
            startActivity(tel);
        }else if(btn.getId()==R.id.bt_intent_clock){
            Intent clock = new Intent(AlarmClock.ACTION_SET_ALARM)
                    .putExtra(AlarmClock.EXTRA_MESSAGE, "下午两点二十的闹钟")
                    .putExtra(AlarmClock.EXTRA_HOUR, 14)
                    .putExtra(AlarmClock.EXTRA_MINUTES, 20);
            startActivity(clock);

        }else if(btn.getId()==R.id.bt_intent_duanxin){

        }



    }
}